import React from "react";
import { View, StyleSheet, Dimensions, TouchableOpacity, Text } from "react-native";

const w = Dimensions.get("window").width;
const h = Dimensions.get("window").height;

class demo4 extends React.Component {
  state={
    num:100
  }

  ontouch=()=>{
    console.log(this.state);
  }
  render() {
    return (
     <View>
       <TouchableOpacity onPress={this.ontouch}>
         <Text>点击试试{this.state.num}</Text>
       </TouchableOpacity>
     </View>
    );
  }
}

const styles = StyleSheet.create({

});

export default demo4;
